Skip to main content

Array

The Array in Hedgehog Script is very useful for storing and managing data.

You can create and print an array:

 

You can add or remove items from an array:

 

tip

Use the length method to return the length of an Array : arrayName.length)!

And to reference elements simply call arrayName[indexOfElement]

You can iterate over an array:

info

An arrow function was used above, check out: Arrow Functions - MDN or the section Arrow Functions for more info.

Here's an Array being used for data storage & management (an Array object is required as a parameter):